#ifndef TRAY_H
#define TRAY_H

#include <QSystemTrayIcon>
#include <QTimer>
#include <QDateTime>

class Tray : public QSystemTrayIcon
{
    Q_OBJECT

public:
    Tray(QObject *parent = nullptr);
    ~Tray();
    void notify(const QString &summary, const QString &body);

private:
    QDateTime m_timeStart;
    QDateTime m_timeEnd;
    QTimer m_timer;
    QString m_lastTip;
    bool m_offDutyNotifyed = false;

    QDateTime markStartTime();
    void setTip(const QString &text);

private slots:
    void handleTimer();
};
#endif // TRAY_H
